package com.joseph.websocket.test;

import com.google.common.util.concurrent.Uninterruptibles;
import com.joseph.websocket.util.JedisUtil;
import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import sun.misc.Unsafe;

import java.lang.reflect.Field;
import java.util.Queue;
import java.util.concurrent.*;

public class JOL {

    public static void main(String[] args) throws InterruptedException {
//        JedisUtil.getJedis().setbit("XINYUN_IM_SERVER_ID_KEY", 0, false);
        Config config = new Config();
        config.useSingleServer().setPassword("EXOvkbhh").setAddress("redis://172.30.4.48:6379");
        RedissonClient redissonClient;
        redissonClient = Redisson.create(config);
        RLock lock = redissonClient.getLock("josephmok1");
        System.out.println(lock.tryLock(3, 3, TimeUnit.SECONDS));
        Thread.sleep(100000);
        lock.unlock();
    }
}
